package cn.roadtrip.utilmodule.util.enumpck;

/**
 * 客户报团订单状态
 */
public enum Enum_TravelGroupTourOrderStats {
    Waitpay("Waitpay", "已报名，待付款"),
    Mark("Mark", "已报名候选"),
    MarkPayed("MarkPayed", "候选已付款"),
    Payed("Payed", "已付款"),
    Join("Join", "付款成功，已入团"),

    Payback("Payback", "已退款"),
    Out("Out", "已离开"),
    Timeout("Timeout", "超时退出"),
    Finished("Finished", "已完成，不可更改"),
    PayFail("PayFail", "付款失败"),
    Dispatched("Dispatched", "已被调度");

    private String s;
    private String title;

    Enum_TravelGroupTourOrderStats(String s, String title) {
        this.s = s;
        this.title = title;
    }

    Enum_TravelGroupTourOrderStats(String s) {
        this.s = s;
        this.title = Enum_CarDetailType.parseCode(s).getTitle();
    }

    public String getTitle() {
        return this.title;
    }

    public String getCode() {
        return this.s;
    }

    public static final Enum_TravelGroupTourOrderStats parseCode(String code) {
        switch (code) {
            case "Waitpay":
                return Waitpay;
            case "Mark":
                return Mark;
            case "Payed":
                return Payed;
            case "Join":
                return Join;

            case "Payback":
                return Payback;
            case "Out":
                return Out;
            case "Timeout":
                return Timeout;
            case "Finished":
                return Finished;
            case "PayFail":
                return PayFail;
            case "Dispatched":
                return Dispatched;
        }
        return null;
    }

    @Override
    public String toString() {
        return "(code:%s, title:%s)".formatted(this.s, this.title);
    }

}
